package net.lahuobao.enums.mall.admin;

/**
 * Created by Clark on 2016/9/25.
 * 0 不补贴，1 金额，2折扣，3满减
 */
public enum EMallSubsidyType {
    No {
        public int getValue() {
            return 0;
        }
        public String getName() {
            return "不补贴";
        }
    },
    Money {
        public int getValue() {
            return 1;
        }

        public String getName() {
            return "金额";
        }
    },
    Subsidy {
        public int getValue() {
            return 2;
        }

        public String getName() {
            return "折扣";
        }
    },
    Mj {
        public int getValue() {
            return 3;
        }

        public String getName() {
            return "满减";
        }
    };

    public static String valueOf(int value) {
        switch (value) {
            case 0:
                return EMallSubsidyType.No.getName();
            case 1:
                return EMallSubsidyType.Money.getName();
            case 2:
                return EMallSubsidyType.Subsidy.getName();
            case 3:
                return EMallSubsidyType.Mj.getName();
        }
        return null;
    }

    public static EMallSubsidyType getMallSubsidySource(int value) {
        switch (value) {
            case 0:
                return EMallSubsidyType.No;
            case 1:
                return EMallSubsidyType.Money;
            case 2:
                return EMallSubsidyType.Subsidy;
            case 3:
                return EMallSubsidyType.Mj;
        }
        return null;
    }
    public abstract int getValue();

    public abstract String getName();
}
